package com.ht.utils.htmlBean;

import com.ht.utils.config.WordAndHtmlConfig;
import lombok.Data;

@Data
public class PPRFormat {
    private String fontFamily;
    private String fontSize;
    private String fontWeight;
    private String fontStyle;
    private String fontColor;
    private String titleLev;
    private float marginLeft;
    private float firstLine;
    public String toHtml(String content){
        StringBuilder html = new StringBuilder("<p style=\"");
        if(fontFamily != null){
            html.append(" font-family:'").append(WordAndHtmlConfig.getZiTiByWord(fontFamily)).append("' ");
        }
        if(fontColor != null){
            html.append(" color:").append(fontColor).append(" ");
        }
        if(fontSize != null){
            html.append(" font-size: ").append(fontSize).append("pt ");
        }
        html.append(" \" ");
        if(titleLev != null){
            html.append(" data-class='title-").append(titleLev).append("' ");
        }
        return html.toString();
    }

}
